import { Accessor } from "solid-js";

export default function getVideoSrc(
  el: HTMLVideoElement,
  accessor: Accessor<MediaStream>
) {
  const mediaStream = accessor();
  if ("srcObject" in el) {
    el.srcObject = mediaStream;
  } else {
    el.src = URL.createObjectURL(mediaStream);
  }
}
